package yf.mall.vo.down;


import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.*;
import java.io.Serializable;



import yf.mall.entity.CommentEntity;
import yf.mall.vo.CommentVo;

                                        import yf.mall.enums.CommentStatusEnum;

/**
 * 评论实体
 * 表名 comment
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Sep 15 10:27:09 CST 2020
 */
@Data
public class CommentDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

                        //
            @ExcelProperty("")
            private Long id;
        
                        //IMG-头像
            @ExcelProperty("IMG-头像")
            private String avatar;
        
                        //名称
            @ExcelProperty("名称")
            private String name;
        
                        //用户id
            @ExcelProperty("用户id")
            private Long userId;
        
                        //订单item_id
            @ExcelProperty("订单item_id")
            private Long itemId;
        
                        //产品id
            @ExcelProperty("产品id")
            private Long goodsId;
        
                        //评论内容
            @ExcelProperty("评论内容")
            private String content;
        
                        //IMG-评论内容图片
            @ExcelProperty("IMG-评论内容图片")
            private String img;
        
                        //评论时间
            @ExcelProperty("评论时间")
            private Date time;
        
                        //ENUM-是否默认:"NO- 未通过","YES-通过"
            @ExcelIgnore
            private Integer status;
                        @ExcelProperty("是否默认")
            private String statusStr;
        
    
    public CommentDown() {

    }

    public CommentDown(CommentVo vo) {
        CommentEntity entity = vo.getEntity();
                                    this.setId(entity.getId());
            
                                    this.setAvatar(entity.getAvatar());
            
                                    this.setName(entity.getName());
            
                                    this.setUserId(entity.getUserId());
            
                                    this.setItemId(entity.getItemId());
            
                                    this.setGoodsId(entity.getGoodsId());
            
                                    this.setContent(entity.getContent());
            
                                    this.setImg(entity.getImg());
            
                                    this.setTime(entity.getTime());
            
                                    this.setStatus(entity.getStatus());
                if(entity.getStatus()!=null){
                    this.setStatusStr( CommentStatusEnum.indexOf(entity.getStatus()));
                }
            
            }


}
